const express = require("express");
// 使用express路由
const departmentMsgRouter = express.Router();
// 导入路由处理模块
const depamentMsgController = require("../Controller/departmentMsg");

// 获取部门消息id列表
departmentMsgRouter.get(
  "/getDepartmentMsg",
  depamentMsgController.getDepartmentMsg
);
// 获取部门消息
departmentMsgRouter.get(
  "/getDepartmentMsgList",
  depamentMsgController.getDepartmentMsgList
);
// 返回用户的阅读列表及状态
departmentMsgRouter.get(
  "/getReadListAndStatus",
  depamentMsgController.getReadListAndStatus
);
// 用户点击消息后对 read_list 删减
departmentMsgRouter.post(
  "/updateReadList",
  depamentMsgController.updateReadList
);
// 把新发布文章的id插入到当前所属部门的rad_list当中
departmentMsgRouter.post(
  "/changUserReadList",
  depamentMsgController.changUserReadList
);
// 删除的文章id从readlist移除
departmentMsgRouter.post(
  "/DeleteUserReadListId",
  depamentMsgController.DeleteUserReadListId
);

// 对外暴露路由
module.exports = departmentMsgRouter;
